WPS Office.apk(点击下载) / jxb.java


package defpackage;

import android.app.Activity;
import android.app.LoaderManager;
import android.content.Loader;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import cn.wps.moffice.common.beans.CommonErrorPage;
import cn.wps.moffice.presentation.control.template.beauty.widget.GridListView;
import cn.wps.moffice.presentation.control.template.beauty.widget.TemplateView;
import cn.wps.moffice_eng.R;

/* renamed from: jxb  reason: default package */
public final class jxb extends jwh implements LoaderManager.LoaderCallbacks<jwy>, View.OnClickListener, AdapterView.OnItemClickListener, GridListView.b {
    public jwg lHd;
    public GridListView lHf;
    private jxj lHg;
    private float lHh;
    private CommonErrorPage lHi;
    public String mContent;

    public jxb(Activity activity) {
        super(activity);
    }

    private void cZu() {
        this.lHf.setClipToPadding(false);
        this.lHf.setPadding(0, (int) this.mActivity.getResources().getDimension(R.dimen.home_template_section_padding), 0, (int) this.mActivity.getResources().getDimension(R.dimen.home_template_list_bottom_padding));
    }

    @Override // cn.wps.moffice.presentation.control.template.beauty.widget.GridListView.b
    public final void auX() {
        a(this);
    }

    @Override // cn.wps.moffice.presentation.control.template.beauty.widget.GridListView.b
    public final void ayM() {
        if (this.lHd != null) {
            jwg jwg = this.lHd;
            TemplateView templateView = this.lGl;
            try {
                if (jwg.lGe != null && templateView != null) {
                    jwh cZm = jwg.lGe.cZm();
                    if (cZm != null) {
                        cZm.getView().getLocalVisibleRect(jwg.cBV);
                        if (!jwg.cBl && jwg.cBV.bottom == cZm.getView().getMeasuredHeight()) {
                            jwg.Ft("beauty_like_show");
                            jwg.cBl = true;
                        }
                        if (jwg.cBV.bottom < cZm.getView().getMeasuredHeight()) {
                            jwg.cBl = false;
                        }
                        jwg.cBV.setEmpty();
                    }
                    if (!jwg.cBl) {
                        jwg.a(templateView, jwg.lGe.cZi());
                        jwg.a(templateView, jwg.lGe.cZk());
                        jwg.a(templateView, jwg.lGe.cZj().getView(), "beauty_recommend_show");
                        jwg.a(templateView, jwg.lGe.cZn().getView(), "beauty_sale_show");
                        if (jwg.lGe.cZl().lHq != null) {
                            jwg.a(templateView, jwg.lGe.cZl().lHq, "beauty_rank_free_show");
                        }
                        if (jwg.lGe.cZl().lHp != null) {
                            jwg.a(templateView, jwg.lGe.cZl().lHp, "beauty_rank_new_show");
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    @Override // defpackage.jwh
    public final void destroy() {
        super.destroy();
        this.lHi.setOnClickListener(null);
        this.lHg.cZx();
        this.lHf = null;
        this.lHg = null;
        this.mContent = null;
        this.lHd = null;
    }

    @Override // defpackage.jwh
    public final void initView() {
        LayoutInflater.from(this.mActivity).inflate(R.layout.template_beauty_list_section, this.lGl);
        this.lHf = (GridListView) this.lGl.findViewById(R.id.content_list_view);
        this.lHi = (CommonErrorPage) this.lGl.findViewById(R.id.empty_layout);
        this.lHi.a(this);
        View inflate = LayoutInflater.from(this.mActivity).inflate(R.layout.listview_loading_view, (ViewGroup) null);
        GridListView gridListView = this.lHf;
        gridListView.cSD = false;
        gridListView.cAU = inflate;
        gridListView.addFooterView(inflate);
        inflate.setVisibility(4);
        gridListView.setOnScrollListener(
        /*  JADX ERROR: Method code generation error
            jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x004e: INVOKE  
              (r1v4 'gridListView' cn.wps.moffice.presentation.control.template.beauty.widget.GridListView)
              (wrap: cn.wps.moffice.presentation.control.template.beauty.widget.GridListView$3 : 0x004b: CONSTRUCTOR  (r0v12 cn.wps.moffice.presentation.control.template.beauty.widget.GridListView$3) = 
              (r1v4 'gridListView' cn.wps.moffice.presentation.control.template.beauty.widget.GridListView)
              (r4v0 'this' jxb A[IMMUTABLE_TYPE, THIS])
             call: cn.wps.moffice.presentation.control.template.beauty.widget.GridListView.3.<init>(cn.wps.moffice.presentation.control.template.beauty.widget.GridListView, cn.wps.moffice.presentation.control.template.beauty.widget.GridListView$b):void type: CONSTRUCTOR)
             type: VIRTUAL call: cn.wps.moffice.presentation.control.template.beauty.widget.GridListView.setOnScrollListener(android.widget.AbsListView$OnScrollListener):void in method: jxb.initView():void, file: classes6.dex
            	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
            	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:217)
            	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:110)
            	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:56)
            	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
            	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
            	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:244)
            	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:237)
            	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:342)
            	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:295)
            	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:264)
            	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
            	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
            	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
            	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
            Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x004b: CONSTRUCTOR  (r0v12 cn.wps.moffice.presentation.control.template.beauty.widget.GridListView$3) = 
              (r1v4 'gridListView' cn.wps.moffice.presentation.control.template.beauty.widget.GridListView)
              (r4v0 'this' jxb A[IMMUTABLE_TYPE, THIS])
             call: cn.wps.moffice.presentation.control.template.beauty.widget.GridListView.3.<init>(cn.wps.moffice.presentation.control.template.beauty.widget.GridListView, cn.wps.moffice.presentation.control.template.beauty.widget.GridListView$b):void type: CONSTRUCTOR in method: jxb.initView():void, file: classes6.dex
            	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
            	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119)
            	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103)
            	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:806)
            	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:746)
            	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:367)
            	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:249)
            	... 14 more
            Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: cn.wps.moffice.presentation.control.template.beauty.widget.GridListView, state: GENERATED_AND_UNLOADED
            	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:215)
            	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:630)
            	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:363)
            	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230)
            	... 20 more
            */
        /*
        // Method dump skipped, instructions count: 125
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.jxb.initView():void");
    }

    public final void onClick(View view) {
        if (lwd.hx(this.mActivity)) {
            a(this);
        }
    }

    @Override // cn.wps.moffice.presentation.control.template.beauty.widget.TemplateView.a
    public final void onConfigurationChanged(Configuration configuration) {
        jwk.a(this.lHf, this.lHg, configuration, this.lHh);
    }

    @Override // android.app.LoaderManager.LoaderCallbacks
    public final Loader<jwy> onCreateLoader(int i, Bundle bundle) {
        jwk.a(this.lHf, this.lHg, this.mActivity.getResources().getConfiguration(), this.lHh);
        if (this.lHf.getAdapter() == null) {
            this.lHf.setAdapter((ListAdapter) this.lHg);
        }
        switch (i) {
            case 0:
                this.lHf.setClipToPadding(false);
                this.lHf.setPadding(0, 0, 0, (int) this.mActivity.getResources().getDimension(R.dimen.home_template_list_bottom_padding));
                jwr jwr = new jwr();
                jwr.page = this.lHg.getCount() == 0 ? 1 : this.lHg.getCount();
                jwr.pageNum = this.hnA;
                jwr.lGK = jwk.dx(this.lHh);
                jwj.cZo();
                jwr.title = jwj.getTitle();
                jwr.lGL = cqy.asP();
                jwr.lGJ = jyw.daa();
                jwp cZs = jwp.cZs();
                jwo jwo = new jwo(this.mActivity.getApplicationContext());
                jwo.mRequestUrl = "https://easy.wps.cn/wppv3/fetch/libguesslike";
                jwo.laA = 1;
                jwo.lGF = cZs.mGson.toJson(jwr);
                jwo.laC = 
                /*  JADX ERROR: Method code generation error
                    jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x00e2: IPUT  
                      (wrap: java.lang.reflect.Type : 0x00de: INVOKE  (r1v8 java.lang.reflect.Type) = (wrap: jwp$2 : 0x00db: CONSTRUCTOR  (r1v7 jwp$2) = (r3v5 'cZs' jwp) call: jwp.2.<init>(jwp):void type: CONSTRUCTOR) type: VIRTUAL call: jwp.2.getType():java.lang.reflect.Type)
                      (r0v27 'jwo' jwo)
                     jwo.laC java.lang.reflect.Type in method: jxb.onCreateLoader(int, android.os.Bundle):android.content.Loader<jwy>, file: classes6.dex
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:217)
                    	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:110)
                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:56)
                    	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
                    	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:99)
                    	at jadx.core.codegen.RegionGen.makeSwitch(RegionGen.java:274)
                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                    	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
                    	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:244)
                    	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:237)
                    	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:342)
                    	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:295)
                    	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:264)
                    	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
                    	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                    	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
                    Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x00de: INVOKE  (r1v8 java.lang.reflect.Type) = (wrap: jwp$2 : 0x00db: CONSTRUCTOR  (r1v7 jwp$2) = (r3v5 'cZs' jwp) call: jwp.2.<init>(jwp):void type: CONSTRUCTOR) type: VIRTUAL call: jwp.2.getType():java.lang.reflect.Type in method: jxb.onCreateLoader(int, android.os.Bundle):android.content.Loader<jwy>, file: classes6.dex
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119)
                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103)
                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:428)
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:249)
                    	... 19 more
                    Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x00db: CONSTRUCTOR  (r1v7 jwp$2) = (r3v5 'cZs' jwp) call: jwp.2.<init>(jwp):void type: CONSTRUCTOR in method: jxb.onCreateLoader(int, android.os.Bundle):android.content.Loader<jwy>, file: classes6.dex
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119)
                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103)
                    	at jadx.core.codegen.InsnGen.addArgDot(InsnGen.java:87)
                    	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:715)
                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:367)
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230)
                    	... 23 more
                    Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: jwp, state: GENERATED_AND_UNLOADED
                    	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:215)
                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:630)
                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:363)
                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230)
                    	... 29 more
                    */
                /*
                // Method dump skipped, instructions count: 340
                */
                throw new UnsupportedOperationException("Method not decompiled: defpackage.jxb.onCreateLoader(int, android.os.Bundle):android.content.Loader");
            }

            @Override // android.widget.AdapterView.OnItemClickListener
            public final void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                jwx jwx = (jwx) this.lHg.getItem(i);
                jwg.eC("beauty_templates_%s_click", this.mCategory + "_" + (jwx.price > 0 ? "1" : "0"));
                jwj.cZo().a(this.mActivity, jwx, "android_beauty_ppt", this.mCategory, "android_docervip_beautytemplate", "android_credits_beautytemplate");
            }

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [android.content.Loader, java.lang.Object] */
            @Override // android.app.LoaderManager.LoaderCallbacks
            public final /* synthetic */ void onLoadFinished(Loader<jwy> loader, jwy jwy) {
                boolean z = false;
                jwy jwy2 = jwy;
                try {
                    this.lGl.findViewById(R.id.access_to_services_progress).setVisibility(8);
                    if (jwy2 == null || jwy2.lGW == null || jwy2.lGW.lGT == null) {
                        this.lHf.setHasMoreItems(false);
                    } else {
                        if (jwy2.lGW.lGT.size() >= this.hnA && this.lHg.getCount() < 50) {
                            z = true;
                        }
                        this.lHf.setHasMoreItems(z);
                        this.lHg.cY(jwy2.lGW.lGT);
                    }
                    if (this.lHg.getCount() == 0) {
                        this.lHf.setVisibility(8);
                        this.lHi.setVisibility(0);
                        return;
                    }
                    this.lHf.setVisibility(0);
                    this.lHi.setVisibility(8);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            @Override // android.app.LoaderManager.LoaderCallbacks
            public final void onLoaderReset(Loader<jwy> loader) {
            }

            public final void refresh() {
                if (this.lHg != null) {
                    this.lHg.notifyDataSetChanged();
                }
            }
        }